from frontend.roleApplication import RoleApplication
from frontend.form import Type
from vars import *



class GenericMiddleOrEndingRole(RoleApplication):

    def __init__(self):
        super(GenericMiddleOrEndingRole, self).__init__(WorkflowName, "ThisRoleName")
        # Here we use SINK step.  This lets the user choose a pre-existing record to work with from a queue on the left side
        self.register_sink_step("ThisStepName", self.generic_middle_or_ending_role_form_creator)
        
    def generic_middle_or_ending_role_form_creator(self, stepname, form):
        form.add_static_label('This is a static label! Use it as a header and section separator!')
        form.add_field(Type.SHORTSTRING, "SampleText", labeltext="Sample Text Field", initial="This is the default value!")
        form.add_field(Type.BOOLEAN, 'SampleYesNo',labeltext="Sample Yes/No Field", initial=False)

if __name__ == '__main__':
    app = GenericMiddleOrEndingRole()
    app.MainLoop()